<?php
// create_database.php
try {
$db = new PDO('sqlite:./SQL/userlite.db');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$query = "CREATE TABLE IF NOT EXISTS users (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    username TEXT NOT NULL,
    password TEXT NOT NULL
)";

$db->exec($query);
echo "Database and table created successfully!";
} catch (PDOException $e) {
echo "An error occurred: " . $e->getMessage();
echo "Database and table create failed";
echo "ERROR CODE: C0001";
}
